package com.baor.controller;


import com.baor.domain.AdjustVo;
import com.baor.service.AdjustService;
import com.baor.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/adjust")
public class AdjustController {

    @Autowired
    private AdjustService adjustService;

    @RequestMapping("/list")
    public AjaxResult<?> list(@RequestBody Map<String,Object> map){
        return adjustService.list(map);
    }

    @RequestMapping("/insert")
    public AjaxResult<?> insert(@RequestBody AdjustVo adjustVo){
        return adjustService.insert(adjustVo);
    }

    @RequestMapping("/update")
    public AjaxResult<?> update(@RequestBody AdjustVo adjustVo){
        return adjustService.update(adjustVo);
    }

    @RequestMapping("/superiors/{userId}")
    public AjaxResult<?> superiors(@PathVariable Integer userId){
        return adjustService.superiors(userId);
    }


}
